<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<link href="./css/ltcss.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PayChannel</title>
<link href="styles/general.css" rel="stylesheet" type="text/css">
<link href="styles/main.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<script type="text/javascript" src="js/jquery/uploadify/jquery.min.js"></script>

<link rel="stylesheet" type="text/css" href="http://ajax.pupkk.com/dojo/1.7.5/dojo/resources/dojo.css" />
<link rel="stylesheet" type="text/css" href="http://ajax.pupkk.com/dojo/1.7.5/dijit/themes/tundra/tundra.css" />
<script src="http://ajax.pupkk.com/dojo/1.7.5/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
<script type="text/javascript">
		dojo.require("dijit.form.FilteringSelect");
		
function txcheck(){
	return formvalidator("all");
}
function formvalidator(obj)
{
	var controlId = "all";
	 if (typeof(obj) != "string" )
	 {
		 controlId = obj.id;
	 }
	if(controlId=="all" || controlId=="model.channelid")
	{
		if(Utils.trim(document.getElementById("model.channelid").value)=="")
		{
			document.getElementById("CompareValidator1").style.visibility="visible";
			return false;
		}
		else
		{
			document.getElementById("CompareValidator1").style.visibility="hidden";
		}
	}
	if(controlId=="all" || controlId=="model.appversionnumber")
	{
		if(Utils.trim(document.getElementById("model.appversionnumber").value)=="")
		{
			document.getElementById("CompareValidator2").style.visibility="visible";
			return false;
		}
		else
		{
			document.getElementById("CompareValidator2").style.visibility="hidden";
		}
	}
	
	return true;
}

function changeappversion(val){
	$.get("channelpercent_changeappversion.do?model.appnumber="+val,function(data){
		$("#appversiondiv").html(data);
	});
}

</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="channelpercent_save.do?msg=<s:property value="msg" />" onsubmit="return txcheck();">
 <input type="hidden" name="model.id" id="model.id" value="<s:property value="model.id"/>" />
 <input type="hidden" id="model.createuser" name="model.createuser"  value="<s:property value="model.createuser" />" />
 <input type="hidden" id="model.createtime" name="model.createtime"  value="<s:property value="model.createtime" />" />
 <h1>
        <span class="action-span"><a href="channelpercent_list.do">配置列表</a></span> <span
            class="action-span1"><a href="">
                首页</a> </span><span id="search_id" class="action-span1">- 配置管理 </span>
        <div style="clear: both">
        </div>
    </h1>
 <div style="margin-bottom: 5px;" class="list-div">
        <table width="100%" cellspacing="1" cellpadding="3">
            <tbody>
                <tr>
                    <th colspan="2">
                        基本信息
                    </th>
                </tr>
                <tr> 
				    <td  class="label"><div align="right">渠道：</div></td> 
				    <td>
				    <select id="model.channelid" name="model.channelid" onchange="formvalidator(this)" dojoType="dijit.form.FilteringSelect" style="width:175px">
				    	<option value="">--请选择--</option>
				    	<s:iterator value="chlist">
				    	<option <s:if test="id.equals(model.channelid)">selected</s:if> value='<s:property value="id" />'><s:property value="name" /></option>
				    	</s:iterator>
				    </select>
						<span
                           class="require-field">*</span>&nbsp;
                        <span id="CompareValidator1" style="color:Red;visibility:hidden;">不能为空</span><br />
                    </td>
				  </tr>
				  <tr> 
				    <td class="label"><div align="right">游戏：</div></td> 
				    <td>
				    <select name="model.appnumber" onchange="changeappversion(this.value);" dojoType="dijit.form.FilteringSelect" style="width:175px">
				    	<option value="">--请选择--</option>
				    	<s:iterator value="applist">
				    	<option <s:if test="appnumber.equals(model.appnumber)">selected</s:if> value='<s:property value="appnumber" />'><s:property value="appname" /></option>	
				    	</s:iterator>
				    </select>
                    </td>
				  </tr>
				  <tr> 
				    <td class="label"><div align="right">游戏版本：</div></td> 
				    <td ><div id="appversiondiv"><jsp:include page="_changeappversion.jsp" /></div></td>
				  </tr>
				  <tr> 
				    <td class="label"><div align="right">比例值：</div></td> 
				    <td>
					   <input value="<s:property value="model.daypercent" />" size="24" name="model.daypercent" />
                    </td>
				  </tr>			 
				  <tr>
                    <td colspan="2" align="center">
                     <s:if test="isUpdate.equals('true')">
					    <input type="submit" value=" 确定 " class="button" />
					 </s:if>
                        &nbsp;&nbsp;&nbsp;
                        <input type="reset" value=" 重置 " class="button" />
                    </td>
                </tr>
	 	</tbody>
	 </table>
 </div>
</form>
 <!--Bottom开始-->
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
  
</body>
</html>